package io;

import java.io.*;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("demo.txt");
        FileOutputStream fos = new FileOutputStream("democp.txt");
//        File file=new File("democp.txt");
//        file.delete();
        int d;
        long start=System.currentTimeMillis();
        while ((d = fis.read()) != -1) {
            fos.write(d);
        }
        long end=System.currentTimeMillis();
        System.out.println("输出时间为"+(end-start)+"毫秒");
        System.out.println("copy完毕！");
        fis.close();
        fos.close();
    }
}
